package ldk.apps.compass


import android.content.Context
import android.graphics.Color
import android.os.Bundle
import android.preference.PreferenceActivity
import android.preference.PreferenceFragment
import android.preference.PreferenceManager

/**
 * 设置页面
 * Created by ldk on 1/29/18.
 */
class SettingsActivity: PreferenceActivity() {

    companion object {
        fun getFontColor(context: Context): Int {
            return PreferenceManager.getDefaultSharedPreferences(context).getInt("font_color", Color.BLACK)
        }

        fun getBgColor(context: Context): Int{
            return PreferenceManager.getDefaultSharedPreferences(context).getInt("bg_color", Color.GREEN)
        }

        fun getCompassColor(context: Context): Int{
            return PreferenceManager.getDefaultSharedPreferences(context).getInt("compass_color", Color.BLACK)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        addPreferencesFromResource(R.xml.fragment_settings)
    }
}